// 接口类型
interface outDataType {
    gender?: string,
    birthday?: string[],
    registerFrom?: string,
    registerTime?: string[],
    status?: string,
    memberState?: string,
    consumMoney?: number[],
    consumTimes?: number[],
    lastConsumDate?: string[]
}
// 将数据转化为后端需要的格式
export const formateData = (inData: any) => {

    const outData: outDataType = {}
    if (inData.gender) outData.gender = inData.gender
    if (inData.birthday.min && inData.birthday.max) outData.birthday = [inData.birthday.min, inData.birthday.max]
    if (inData.regOrigin) outData.registerFrom = inData.regOrigin
    if (inData.regTime.min && inData.regTime.max) outData.registerTime = [inData.regTime.min, inData.regTime.max]
    if (inData.status) outData.status = inData.status
    if (inData.memberState) outData.memberState = inData.memberState
    if (inData.consumeMoney.min && inData.consumeMoney.max) outData.consumMoney = [Number(inData.consumeMoney.min), Number(inData.consumeMoney.max)]
    if (inData.consumeTimes.min && inData.consumeTimes.max) outData.consumTimes = [Number(inData.consumeTimes.min), Number(inData.consumeTimes.max)]
    if (inData.lastConsumeDate.min && inData.lastConsumeDate.max) outData.lastConsumDate = [inData.lastConsumeDate.min, inData.lastConsumeDate.max]
    return outData
}